//#define __FORCE_TRACE__
//#define __FORCE_DEBUG__
//#define __FORCE_INFO__
#define THIS_FILE "tyr_repair\main.sqf"
#include <functions\core_macros.h>

TRACE("Start");
TMFPROFILERSTART;

if (isnil "PAPABEAR") then { PAPABEAR = [playerSide,"HQ"]; };

if (!isDedicated && hasInterface) then {
	0 spawn {
		waituntil {!isNull player && player == player};
		GVAR(Trigger) = createTrigger["EmptyDetector",[0,0,0]];
		GVAR(Trigger) setTriggerArea [0, 0, 0, false];
		GVAR(Trigger) setTriggerActivation ["NONE", "PRESENT", true];
		GVAR(Trigger) setTriggerStatements ["[player] call tyr_rep_fnc_trigger", "[player, true] call tyr_rep_fnc_updateActions;", "[player, false] call tyr_rep_fnc_updateActions;"];
		TRACE_1("Trigger",GVAR(Trigger));
		GVAR(is_engineer) = (player getVariable ["TYR_REP_ENGINEER",false]) || ((typeof player) in GVAR(RepairEngineerList));
		TRACE_1("Engineer",GVAR(is_engineer));
	};
};

TRACE("End");
TMFPROFILERSTOP;